import Vue from 'vue'
import Router from 'vue-router'
import search from '../pages/search/search'
import index from '../pages/index'
import news from '../pages/news'
import user from '../pages/user/user'
import login from '../pages/user/login'
import register from '../pages/user/register'
import resetPassWord from '../pages/user/resetPassWord'
import articlePage from '../pages/articlePage'
Vue.use(Router)
export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'index',
      component: index,
      redirect: '/information',
      meta: {
        auth: false,
        title: '首页',
        footer: false
      }
    },
    {
      path: '/information',
      name: 'information',
      component: news,
      meta: {
        auth: false,
        title: '创投内参',
        footer: false
      }
    },
    {
      path: '/hot',
      name: 'hot',
      component: news,
      meta: {
        auth: false,
        title: '创投内参',
        footer: false
      }
    },
    {
      path: '/subscribe',
      name: 'subscribe',
      component: news,
      meta: {
        auth: true,
        title: '创投内参',
        footer: false
      }
    },
    {
      path: '/custom',
      name: 'custom',
      component: news,
      meta: {
        auth: true,
        title: '创投内参',
        footer: false
      }
    },
    {
      path: '/search',
      name: 'search',
      component: search,
      meta: {
        auth: false,
        title: '搜索',
        footer: false
      }
    },
    {
      path: '/user',
      name: 'user',
      component: user,
      redirect: '/user/login',
      children: [
        {
          path: 'login',
          name: 'login',
          component: login,
          meta: {
            auth: false,
            title: '登录',
            footer: false
          }
        },
        {
          path: 'register',
          name: 'register',
          component: register,
          meta: {
            auth: false,
            title: '注册',
            footer: false
          }
        },
        {
          path: 'resetPassWord',
          name: 'resetPassWord',
          component: resetPassWord,
          meta: {
            auth: false,
            title: '重置密码',
            footer: false
          }
        }
      ]
    },
    {
      path: '/articlePage:id',
      name: 'articlePage',
      component: articlePage,
      meta: {
        auth: false,
        title: '创投内参',
        footer: false
      }
    },
    {
      path: '*',
      redirect: '/information'
    }
  ]
})
